<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0"><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 
        <title>Welcome to Design Zone......</title>
        <link rel="stylesheet" type="text/css" href="../../scripts/ext/resources/css/ext-all.css" />
        <link rel="stylesheet" type="text/css" href="../../scripts/ext/resources/css/file-upload.css" />
        <link rel="stylesheet" type="text/css" href="../../styles/dzbase.css" />
        <script type="text/javascript" src="../../scripts/ext/adapter/ext-base.js">
        </script>
        <script type="text/javascript" src="../../scripts/ext/ext-all.js">
        </script>
		<script type="text/javascript" src="../../scripts/menu/EditableItem.js">
        </script>
        <script type="text/javascript" src="../../scripts/menu/RangeMenu.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/GridFilters.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/Filter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/StringFilter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/ListFilter.js">
        </script>
		<script type="text/javascript" src="../../scripts/grid/filter/DateFilter.js"></script>
		<script type="text/javascript" src="../../scripts/grid/RowExpander.js">
        </script>
        <script type="text/javascript" src="../../scripts/form/FileUploadField.js">
        </script>
        <script type="text/javascript" src="../../scripts/i18nMessage.js">
        </script>
        <script type="text/javascript" src="../../scripts/utils.js">
        </script>
        <script type="text/javascript" src="../../scripts/selectMeasureSpecification.js">
        </script>
		<script type="text/javascript" src="../../scripts/multiSelectProductIdentification.js">
        </script>
        <script type="text/javascript">
            var piMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.productidentification');
			var referenceMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.reference');
			var fcMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.francecustomer');
            var message = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=message');
			
			var idValue = getPrarmeterValue(window.location, 'id');
            var startPage = getPrarmeterValue(window.location, 'startPage');
			var ctVersionBefore = getPrarmeterValue(window.location, 'version');
            
            var customerXmlLoader = new xmlLoader('../../servlet/BiFranceCustomerServlet?action=5');
            var ctDesignTypeXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtDesignType');
            var ctCostumeCategoryXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtCostumeCategory');
            var ctMachineTypeXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtMachineType');
            var ctCollarTypeXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtCollarType');
			var ctVersionXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtVersion');
			var ctSeasonNumberXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtSeasonNumber');
			var ctProductFamilyXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtProductFamily');
            
            var customerStore;
            var ctDesignTypeStore;
            var ctCostumeCategoryStore;
            var ctMachineTypeStore;
            var ctCollarTypeStore;
			var ctVersionStore;
			var ctSeasonNumberStore;
			var ctProductFamilyStore;
            
            var customerCombo;
            var ctDesignTypeCombo;
            var ctCostumeCategoryCombo;
            var ctMachineTypeCombo;
            var ctCollarTypeCombo;
			var ctProductFamilyCombo;
			var ctVersionCombo;
			var ctSeasonNumberCombo;
			
			var productIdentificationForm;
			
			var selectProductIdentificationCallBack = function(selectedIds, selectedRecords){
				if(selectedIds.length == 0){
					return;
				}
				var id = selectedIds[0];
				
				productIdentificationForm.getForm().load({
						url:'../../servlet/ProductIdentificationServlet?action=3&id=' + id, 
						waitMsg:Ext.LoadMask.prototype.msg, 
						success: function(form, action){
							document.getElementById('customImg').src =  '../../_temp/' + document.getElementById('chartName').value;
							document.getElementById('customImg1').src =  '../../_temp/' + document.getElementById('photoName').value;
							document.getElementById('id').value = '';
							//document.getElementById('patronageNumer').value = '';
							//document.getElementById('similarId').value = id;
						}
				});
			};
            
            var selectMsCallback = function(id, name){
                document.getElementById('biMeasureSpecificationId').value = id;
                document.getElementById('biMeasureSpecificationName').value = name;
            }
			
            
            Ext.onReady(function(){
                Ext.QuickTips.init();
                Ext.form.Field.prototype.msgTarget = 'side';
                
                customerStore = new Ext.data.Store({
                
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'id',
                        totalRecords: 'itemTotal'
                    }, ['id', 'name', 'department']),
                    data: customerXmlLoader.getXml()
                });
                
                ctDesignTypeStore = new Ext.data.Store({
                
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, ['code', 'description']),
                    data: ctDesignTypeXmlLoader.getXml()
                });
                
                ctCostumeCategoryStore = new Ext.data.Store({
                
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, ['code', 'description']),
                    data: ctCostumeCategoryXmlLoader.getXml()
                });
                
                ctMachineTypeStore = new Ext.data.Store({
                
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, ['code', 'description']),
                    data: ctMachineTypeXmlLoader.getXml()
                });
                
                ctCollarTypeStore = new Ext.data.Store({
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'code', 'description']),
					data: ctCollarTypeXmlLoader.getXml()
                });
				
				ctVersionStore = new Ext.data.Store({
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'code', 'description']),
					data: ctVersionXmlLoader.getXml()
                });
				
				ctSeasonNumberStore = new Ext.data.Store({
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'code', 'description']),
					data: ctSeasonNumberXmlLoader.getXml()
                });
				
				ctProductFamilyStore = new Ext.data.Store({
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'code', 'description']),
					data: ctProductFamilyXmlLoader.getXml()
                });
				
				ctProductFamilyStore.each(function(record){
					//alert(record.data.code);
					if(record.data.code < 20){
						ctProductFamilyStore.remove(record);
					}
				});
                
                customerCombo = new Ext.form.ComboBox({
                    fieldLabel: message.get('message.edit.customername'),
                    id: 'customerId',
                    name: 'customerId',
                    allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
                    tpl: '<tpl for="."><div class="x-combo-list-item">{name}&nbsp;&nbsp;--&nbsp;&nbsp;{department}</div></tpl>',
                    valueField: 'id',
                    typeAhead: true,
                    store: customerStore,
                    displayField: 'name',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local'
                });
                
                ctDesignTypeCombo = new Ext.form.ComboBox({
                    fieldLabel: piMessage.get('ui.productidentification.designtype'),
                    id: 'ctDesignType',
                    name: 'ctDesignType',
                    allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
                    valueField: 'code',
                    typeAhead: true,
                    store: ctDesignTypeStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local'
                });
                
                ctCostumeCategoryCombo = new Ext.form.ComboBox({
                    fieldLabel: piMessage.get('ui.productidentification.costumecategory'),
                    id: 'ctCostumeCategory',
                    name: 'ctCostumeCategory',
                    allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
                    valueField: 'code',
                    typeAhead: true,
                    store: ctCostumeCategoryStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local'
                });
                
                ctCollarTypeCombo = new Ext.form.ComboBox({
					fieldLabel: message.get('message.edit.collar'),
					id: 'ctCollarType',
					name: 'ctCollarType',
					allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
					editable: false,
				    store: ctCollarTypeStore,
					valueField: 'code',
				    displayField:'description',
				    triggerAction: 'all',
				    emptyText: message.get('message.combo.pleaseselect'),
				    selectOnFocus:true,
					mode: 'local',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								//setPatronageNumer();
							}
						}
					}
				});
                
                ctMachineTypeCombo = new Ext.form.ComboBox({
                    fieldLabel: referenceMessage.get('ui.reference.machinetype'),
                    id: 'ctMachineType',
                    name: 'ctMachineType',
                    allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
                    valueField: 'code',
                    typeAhead: true,
                    store: ctMachineTypeStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local'
                });
                
				ctVersionCombo = new Ext.form.ComboBox({
                    fieldLabel: piMessage.get('ui.productidentification.chartversion'),
                    id: 'ctVersion',
                    name: 'ctVersion',
                    allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
                    valueField: 'code',
                    typeAhead: true,
                    store: ctVersionStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local'
                });
				
				ctSeasonNumberCombo = new Ext.form.ComboBox({
                    fieldLabel: piMessage.get('ui.productidentification.seasonnumber'),
                    id: 'ctSeasonNumber',
                    name: 'ctSeasonNumber',
                    allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
                    valueField: 'code',
                    typeAhead: true,
                    store: ctSeasonNumberStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								//setPatronageNumer();
							}
						}
					}
                });
				
				ctProductFamilyCombo = new Ext.form.ComboBox({
                    fieldLabel: message.get('message.edit.productfamily'),
                    id: 'ctProductFamily',
                    name: 'ctProductFamily',
                    allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
                    valueField: 'code',
                    typeAhead: true,
                    store: ctProductFamilyStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								//setPatronageNumer();
							}
						}
					}
                });
                
                productIdentificationForm = new Ext.FormPanel({
                    fileUpload: true,
                    labelAlign: 'left',
                    url: '../../servlet/ProductIdentificationServlet?action=1',
                    frame: true,
                    title: piMessage.get('ui.productidentification.edittitle'),
                    bodyStyle: 'padding:5px 5px 5px 5px;margin-top: 2px;',
                    width: '100%',
                    labelWidth: 105,
                    reader: new Ext.data.XmlReader({
                        record: 'item'
                    }, [{
                        name: 'id',
                        mapping: 'id'
                    }, {
                        name: 'ctCostumeCategory',
                        mapping: 'ctCostumeCategory'
                    }, {
                        name: 'ctMachineType',
                        mapping: 'ctMachineType'
                    }, {
                        name: 'isSimilar',
                        mapping: 'isSimilar'
                    },{
                        name: 'isNewfashioned',
                        mapping: 'isNewfashinoed'
                    },{
                        name: 'isDifficullty',
                        mapping: 'isDifficullty'
                    },{
                        name: 'dhlNumber',
                        mapping: 'dhlNumber'
                    },{
                        name: 'orderNumber',
                        mapping: 'orderNumber'
                    }, {
                        name: 'ctDesignType',
                        mapping: 'ctDesignType'
                    },{
                        name: 'ctCollarType',
                        mapping: 'ctCollarType'
                    }, {
                        name: 'style',
                        mapping: 'style'
                    }, {
                        name: 'customerLinkman',
                        mapping: 'customerLinkman'
                    },{
                        name: 'model',
                        mapping: 'model'
                    }, {
                        name: 'ctSeasonNumber',
                        mapping: 'ctSeasonNumber'
                    }, {
                        name: 'biReferenceId',
                        mapping: 'biReferenceId'
                    }, {
                        name: 'reference',
                        mapping: 'reference'
                    }, {
                        name: 'createDate',
                        mapping: 'createDate'
                    }, {
                        name: 'ctVersion',
                        mapping: 'ctVersion'
                    }, {
                        name: 'front',
                        mapping: 'front'
                    }, {
                        name: 'back',
                        mapping: 'back'
                    }, {
                        name: 'sleeves',
                        mapping: 'sleeves'
                    }, {
                        name: 'bottomThrum',
                        mapping: 'bottomThrum'
                    }, {
                        name: 'sleevesThrum',
                        mapping: 'sleevesThrum'
                    }, {
                        name: 'necklineThrum',
                        mapping: 'necklineThrum'
                    }, {
                        name: 'needle',
                        mapping: 'needle'
                    }, {
                        name: 'weight',
                        mapping: 'weight'
                    }, {
                        name: 'comment',
                        mapping: 'comment'
                    }, {
                        name: 'customerId',
                        mapping: 'customerId'
                    }, {
                        name: 'photoName',
                        mapping: 'photoName'
                    }, {
                        name: 'chartName',
                        mapping: 'chartName'
                    }, {
                        name: 'attachment1Name',
                        mapping: 'attachment1Name'
                    }, {
                        name: 'attachment2Name',
                        mapping: 'attachment2Name'
                    }, {
                        name: 'frontPhotoName',
                        mapping: 'frontPhotoName'
                    }, {
                        name: 'backPhotoName',
                        mapping: 'backPhotoName'
                    }, {
                        name: 'otherPhotoName',
                        mapping: 'otherPhotoName'
                    }, {
                        name: 'biMeasureSpecificationId',
                        mapping: 'biMeasureSpecificationId'
                    }, {
                        name: 'biMeasureSpecificationName',
                        mapping: 'biMeasureSpecificationName'
                    }, {
                        name: 'ctProductFamily',
                        mapping: 'ctProductFamily'
                    }, {
                        name: 'referenceIndex',
                        mapping: 'referenceIndex'
                    }]),
                    items: [{
                        xtype: 'fieldset',
                        collapsible: true,
                        title: piMessage.get('ui.productidentification.set1'),
                        autoHeight: true,
                        items: [{
                            id: 'id',
                            name: 'id',
                            xtype: 'hidden'
                        }, {
                            id: 'photoName',
                            name: 'photoName',
                            xtype: 'hidden'
                        }, {
                            id: 'attachment1Name',
                            name: 'attachment1Name',
                            xtype: 'hidden'
                        }, {
                            id: 'attachment2Name',
                            name: 'attachment2Name',
                            xtype: 'hidden'
                        }, {
                            id: 'frontPhotoName',
                            name: 'frontPhotoName',
                            xtype: 'hidden'
                        }, {
                            id: 'backPhotoName',
                            name: 'backPhotoName',
                            xtype: 'hidden'
                        }, {
                            id: 'otherPhotoName',
                            name: 'otherPhotoName',
                            xtype: 'hidden'
                        }, {
                            id: 'chartName',
                            name: 'chartName',
                            xtype: 'hidden'
                        }, {
                            id: 'referenceIndex',
                            name: 'referenceIndex',
                            xtype: 'hidden'
                        }, {
                            name: 'style',
                            fieldLabel: piMessage.get('ui.productidentification.style'),
                            xtype: 'textfield',
                            width: '50%',
                            allowBlank: false,
                            blankText: message.get('message.edit.noblank'),
                            maxLength: 128
                        }, {
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [ctProductFamilyCombo, customerCombo, {
									id: 'customerLinkman',
                                    name: 'customerLinkman',
                                    fieldLabel: message.get('message.edit.linkman'),
                                    xtype: 'textfield',
                                    anchor: '86%',
                                    allowBlank: false,
                                    blankText: message.get('message.edit.noblank'),
                                    maxLength: 64
                                }, {
                                    name: 'model',
                                    fieldLabel: piMessage.get('ui.productidentification.model'),
                                    xtype: 'textfield',
                                    anchor: '86%',
                                    allowBlank: false,
                                    blankText: message.get('message.edit.noblank'),
                                    maxLength: 64
                                }]
                            }, {
                                columnWidth: .5,
                                layout: 'form',
                                items: [ctDesignTypeCombo, ctSeasonNumberCombo, {
                                    name: 'reference',
									id: 'reference',
                                    fieldLabel: referenceMessage.get('ui.reference.reference'),
                                    xtype: 'textfield',
                                    anchor: '86%',
                                    allowBlank: false,
                                    blankText: message.get('message.edit.noblank'),
                                    maxLength: 64,
                                    listeners: {
                                        'render': {
                                            fn: function(){
                                                Ext.getCmp('reference').getEl().on('click', function(){
                                                    //setPatronageNumer();
                                                }, this);
                                            },
                                            scope: this
                                        }
                                    }
                                }, {
                                    name: 'createDate',
                                    fieldLabel: message.get('message.edit.createdate') + "(d/m/Y)",
                                    xtype: 'datefield',
                                    anchor: '60%',
                                    allowBlank: false,
                                    blankText: message.get('message.edit.noblank')
                                }]
                            }]
                        }]
                    },{
                        xtype: 'fieldset',
                        collapsible: true,
                        title: piMessage.get('ui.productidentification.ordernumber'),
                        autoHeight: true,
                        items: [{
                                    name: 'orderNumber',
                                    fieldLabel: piMessage.get('ui.productidentification.ordernumber'),
                                    xtype: 'textfield',
                                    anchor: '86%',
                                    allowBlank: false,
                                    blankText: message.get('message.edit.noblank'),
                                    maxLength: 128,
									maxLengthText: message.get('message.edit.toolong')
                        }]
                    }, {
                        xtype: 'fieldset',
                        collapsible: true,
                        title: piMessage.get('ui.productidentification.set4'),
                        autoHeight: true,
                        items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'chart',
                                    name: 'chart',
                                    fieldLabel: piMessage.get('ui.productidentification.chart'),
                                    xtype: 'fileuploadfield',
                                    anchor: '60%',
                                    emptyText: message.get('message.edit.selectimage'),
                                    buttonCfg: {
                                        text: '',
                                        iconCls: 'uploadIcon'
                                    }
                                },{
									id: 'attachment1',
                                    name: 'attachment1',
                                    fieldLabel: piMessage.get('ui.productidentification.attachment') + '&nbsp;&nbsp;&nbsp;&nbsp;<a id="attachment1A" target="_blank" href=""><img ext: qtip="' + message.get('message.edit.save') + '" src="../../images/icons/disk.png"/></a>',
                                    xtype: 'fileuploadfield',
                                    anchor: '60%',
                                    emptyText: message.get('message.combo.pleaseselect'),
                                    buttonCfg: {
                                        text: '',
                                        iconCls: 'uploadIcon'
                                    }
                                }]
                            }, {
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'photo',
                                    name: 'photo',
                                    fieldLabel: piMessage.get('ui.productidentification.photo'),
                                    xtype: 'fileuploadfield',
                                    anchor: '60%',
									emptyText: message.get('message.combo.pleaseselect'),
                                    buttonCfg: {
                                        text: '',
                                        iconCls: 'uploadIcon'
                                    }
                                },{
									id: 'attachment2',
                                    name: 'attachment2',
                                    fieldLabel: piMessage.get('ui.productidentification.attachment')+ '&nbsp;&nbsp;&nbsp;&nbsp;<a id="attachment2A" target="_blank" href=""><img ext: qtip="' + message.get('message.edit.save') + '" src="../../images/icons/disk.png"/></a>',
                                    xtype: 'fileuploadfield',
                                    anchor: '60%',
                                    emptyText: message.get('message.combo.pleaseselect'),
                                    buttonCfg: {
                                        text: '',
                                        iconCls: 'uploadIcon'
                                    }
                                }]
                            }]
                        }, {
                            fieldLabel: piMessage.get('ui.productidentification.comment'),
                            name: 'comment',
                            xtype: 'textarea',
                            maxLength: 512,
                            width: '90%',
                            maxLengthText: message.get('message.edit.toolong')
                        }]
                    }],
                    
                    buttons: [{
                        text: message.get('message.edit.save'),
                        handler: function(){
                            if (productIdentificationForm.getForm().isValid()) {
                            
								document.getElementsByName('ctProductFamily')[0].value = ctProductFamilyCombo.getValue();
								document.getElementsByName('ctDesignType')[0].value = ctDesignTypeCombo.getValue();
                                document.getElementsByName('ctSeasonNumber')[0].value = ctSeasonNumberCombo.getValue();
								//document.getElementsByName('ctVersion')[0].value = ctVersionCombo.getValue();
                                //document.getElementsByName('ctCostumeCategory')[0].value = ctCostumeCategoryCombo.getValue();
                                //document.getElementsByName('ctMachineType')[0].value = ctMachineTypeCombo.getValue();
                                document.getElementsByName('customerId')[0].value = customerCombo.getValue();
                                //document.getElementsByName('ctCollarType')[0].value = ctCollarTypeCombo.getValue();
                                
                                productIdentificationForm.getForm().submit({
                                    method: 'post',
                                    success: function(form, action){
                                        messageTip.msg(message.get('message.tip'), message.get('message.edit.successful'));
                                        document.getElementById('photo-file').value = null;
                                        document.getElementById('chart-file').value = null;
										document.getElementById('attachment1-file').value = null;
										document.getElementById('attachment2-file').value = null;
                                        productIdentificationForm.getForm().reset();
                                    },
                                    failure: function(form, action){
                                        messageTip.msg(message.get('message.tip'), message.get('message.edit.unsuccessful'));
                                    }
                                });
                            }
                        }
                    },{
                        text: message.get('message.edit.reset'),
                        handler: function(){
                            productIdentificationForm.getForm().reset();
                        }
                    }, {
                        text: message.get('message.edit.cancel'),
                        handler: function(){
                            if (startPage != null) {
                                window.location = 'product_identification_list.html?startPage=' + startPage;
                            }
                            else {
                                window.location = 'product_identification_list.html';
                            }
                        }
                    }]
                });
                
                
                productIdentificationForm.render('productIdentificationForm');
                
				new Ext.Resizable('customImg', {
                    wrap: true,
                    pinned: true,
                    dynamic: true,
                    handles: 'all',
                    draggable: true
                });
                
                new Ext.Resizable('customImg1', {
                    wrap: true,
                    pinned: true,
                    dynamic: true,
                    handles: 'all',
                    draggable: true
                });
				
				if (idValue != null) {
					document.getElementById('id').value = idValue;
					productIdentificationForm.getForm().load({
							url:'../../servlet/ProductIdentificationServlet?action=3&id=' + idValue, 
							waitMsg:Ext.LoadMask.prototype.msg, 
							success: function(form, action){
								document.getElementById('customImg').src =  '../../_temp/' + document.getElementById('chartName').value;
								document.getElementById('customImg1').src =  '../../_temp/' + document.getElementById('photoName').value;
								document.getElementById('attachment2A').href = '../../_temp/' + document.getElementById('attachment2Name').value;
								document.getElementById('attachment1A').href = '../../_temp/' + document.getElementById('attachment1Name').value;
							}
					});
				}
				
            });
        </script>
    </head>
    <body>
        <div id="productIdentificationForm">
        </div>
		
		
        <img id="customImg" src="../../_temp/noimage.gif" style="position:absolute;left: 20%;width: 250px;"/>
		<img id="customImg1" src="../../_temp/noimage.gif" style="position:absolute;left: 60%;width: 250px;"/>
		<!--
		<img id="customImg2" src="../../_temp/noimage.gif" style="position:absolute;left: 40%;width: 250px;"/>
		<img id="customImg3" src="../../_temp/noimage.gif" style="position:absolute;left: 60%;width: 250px;"/>
		<img id="customImg4" src="../../_temp/noimage.gif" style="position:absolute;left: 80%;width: 250px;"/>
		-->
    </body>
</html>